3.175 \(\int \cos ^2(e+f x) (a+b \sec ^2(e+f x))^2 \, dx\)

Optimal. Leaf size=47 \[ \frac{a^2 \sin (e+f x) \cos (e+f x)}{2 f}+\frac{1}{2} a x (a+4 b)+\frac{b^2 \tan (e+f x)}{f} \]

[Out]

(a*(a + 4*b)*x)/2 + (a^2*Cos[e + f*x]*Sin[e + f*x])/(2*f) + (b^2*Tan[e + f*x])/f

________________________________________________________________________________________

Rubi [A]  time = 0.0722403, antiderivative size = 47, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.174, Rules used = {4146, 390, 385, 203} \[ \frac{a^2 \sin (e+f x) \cos (e+f x)}{2 f}+\frac{1}{2} a x (a+4 b)+\frac{b^2 \tan (e+f x)}{f} \]

Antiderivative was successfully verified.

[In]

Int[Cos[e + f*x]^2*(a + b*Sec[e + f*x]^2)^2,x]

[Out]

(a*(a + 4*b)*x)/2 + (a^2*Cos[e + f*x]*Sin[e + f*x])/(2*f) + (b^2*Tan[e + f*x])/f

Rule 4146

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_), x_Symbol] :> With[{ff = Fre
eFactors[Tan[e + f*x], x]}, Dist[ff/f, Subst[Int[(1 + ff^2*x^2)^(m/2 - 1)*ExpandToSum[a + b*(1 + ff^2*x^2)^(n/
2), x]^p, x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[m/2] && IntegerQ[n/2]

Rule 390

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Int[PolynomialDivide[(a + b*x^n)
^p, (c + d*x^n)^(-q), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && IGtQ[n, 0] && IGtQ[p, 0] && ILt
Q[q, 0] && GeQ[p, -q]

Rule 385

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> -Simp[((b*c - a*d)*x*(a + b*x^n)^(p +
 1))/(a*b*n*(p + 1)), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(a*b*n*(p + 1)), Int[(a + b*x^n)^(p + 1), x], x] /
; FreeQ[{a, b, c, d, n, p}, x] && NeQ[b*c - a*d, 0] && (LtQ[p, -1] || ILtQ[1/n + p, 0])

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rubi steps

\begin{align*} \int \cos ^2(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx &=\frac{\operatorname{Subst}\left (\int \frac{\left (a+b+b x^2\right )^2}{\left (1+x^2\right )^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{\operatorname{Subst}\left (\int \left (b^2+\frac{a (a+2 b)+2 a b x^2}{\left (1+x^2\right )^2}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{b^2 \tan (e+f x)}{f}+\frac{\operatorname{Subst}\left (\int \frac{a (a+2 b)+2 a b x^2}{\left (1+x^2\right )^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{a^2 \cos (e+f x) \sin (e+f x)}{2 f}+\frac{b^2 \tan (e+f x)}{f}+\frac{(a (a+4 b)) \operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{2 f}\\ &=\frac{1}{2} a (a+4 b) x+\frac{a^2 \cos (e+f x) \sin (e+f x)}{2 f}+\frac{b^2 \tan (e+f x)}{f}\\ \end{align*}

Mathematica [A]  time = 0.15227, size = 52, normalized size = 1.11 \[ \frac{a^2 (e+f x)}{2 f}+\frac{a^2 \sin (2 (e+f x))}{4 f}+2 a b x+\frac{b^2 \tan (e+f x)}{f} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[e + f*x]^2*(a + b*Sec[e + f*x]^2)^2,x]

[Out]

2*a*b*x + (a^2*(e + f*x))/(2*f) + (a^2*Sin[2*(e + f*x)])/(4*f) + (b^2*Tan[e + f*x])/f

________________________________________________________________________________________

Maple [A]  time = 0.05, size = 51, normalized size = 1.1 \begin{align*}{\frac{1}{f} \left ({a}^{2} \left ({\frac{\sin \left ( fx+e \right ) \cos \left ( fx+e \right ) }{2}}+{\frac{fx}{2}}+{\frac{e}{2}} \right ) +2\,ab \left ( fx+e \right ) +{b}^{2}\tan \left ( fx+e \right ) \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(f*x+e)^2*(a+b*sec(f*x+e)^2)^2,x)

[Out]

1/f*(a^2*(1/2*sin(f*x+e)*cos(f*x+e)+1/2*f*x+1/2*e)+2*a*b*(f*x+e)+b^2*tan(f*x+e))

________________________________________________________________________________________

Maxima [A]  time = 1.50555, size = 72, normalized size = 1.53 \begin{align*} \frac{2 \, b^{2} \tan \left (f x + e\right ) +{\left (a^{2} + 4 \, a b\right )}{\left (f x + e\right )} + \frac{a^{2} \tan \left (f x + e\right )}{\tan \left (f x + e\right )^{2} + 1}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)^2*(a+b*sec(f*x+e)^2)^2,x, algorithm="maxima")

[Out]

1/2*(2*b^2*tan(f*x + e) + (a^2 + 4*a*b)*(f*x + e) + a^2*tan(f*x + e)/(tan(f*x + e)^2 + 1))/f

________________________________________________________________________________________

Fricas [A]  time = 0.488119, size = 134, normalized size = 2.85 \begin{align*} \frac{{\left (a^{2} + 4 \, a b\right )} f x \cos \left (f x + e\right ) +{\left (a^{2} \cos \left (f x + e\right )^{2} + 2 \, b^{2}\right )} \sin \left (f x + e\right )}{2 \, f \cos \left (f x + e\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)^2*(a+b*sec(f*x+e)^2)^2,x, algorithm="fricas")

[Out]

1/2*((a^2 + 4*a*b)*f*x*cos(f*x + e) + (a^2*cos(f*x + e)^2 + 2*b^2)*sin(f*x + e))/(f*cos(f*x + e))

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)**2*(a+b*sec(f*x+e)**2)**2,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [A]  time = 1.42626, size = 77, normalized size = 1.64 \begin{align*} \frac{2 \, b^{2} \tan \left (f x + e\right ) +{\left (a^{2} + 4 \, a b\right )}{\left (f x + e\right )} + \frac{a^{2} \tan \left (f x + e\right )}{\tan \left (f x + e\right )^{2} + 1}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)^2*(a+b*sec(f*x+e)^2)^2,x, algorithm="giac")

[Out]

1/2*(2*b^2*tan(f*x + e) + (a^2 + 4*a*b)*(f*x + e) + a^2*tan(f*x + e)/(tan(f*x + e)^2 + 1))/f